package com.backend.springboot_project_demo.utils;

import java.util.Random;
import java.util.UUID;

public class UuidUtils {
    public static String getUUID(){
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String getRandomString(int length) {
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random = new Random();
        StringBuilder randomData = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int number = random.nextInt(62);
            randomData.append(str.charAt(number));
        }
        return randomData.toString();
    }
}
